/**
 * project: finance-manage
 * package: com.example.models
 * 密码加密工具类
 */

package com.example.util;

import org.mindrot.jbcrypt.BCrypt;

public class HashEncryption {
    // 加密密码
    public static String hashPassword(String password) {
        return BCrypt.hashpw(password, BCrypt.gensalt());
    }

    // 验证密码
    public static boolean verifyPassword(String inputPassword, String hashedPassword) {
        return BCrypt.checkpw(inputPassword, hashedPassword);
    }
}
